package com.ruoyi.time;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component

public class time {
    @Autowired
    private timeSerice timeSerice;

    // 使用 cron 表达式（每天凌晨 2 点执行）
    @Scheduled(cron = "0 0 3 * * ?")
    public void cronTask() {
        System.out.println("Cron Task: " + LocalDateTime.now());
    }

}
